<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<title>业绩查询</title>
		<link rel="stylesheet" type="text/css" href="../../bangnuo/admin/layui/css/layui.css">
		<link rel="stylesheet" type="text/css" href="../../bangnuo/css/box-html.css" />
	</head>
	<body>
		<br /><br />
		<form class="layui-form" action="">
			<div>
				<div style="float: left;">
					<div class="layui-form-item">
						<label class="layui-form-label">业务员姓名</label>
						<div class="layui-input-block">
							<input type="text" name="employeeName" placeholder="业务员姓名" autocomplete="off" class="layui-input">
						</div>
					</div>
				</div>
				<div style="float: left;">
					<div class="layui-form-item">
						<label class="layui-form-label">业务员工号</label>
						<div class="layui-input-block">
							<input type="text" name="employeeId" placeholder="业务员工号" autocomplete="off" class="layui-input">
						</div>
					</div>
				</div>
				<div style="float: left;">
					<div class="layui-form-item">
						<label class="layui-form-label">商户编号</label>
						<div class="layui-input-block">
							<input type="text" name="commercialId" placeholder="商户编号" autocomplete="off" class="layui-input">
						</div>
					</div>
				</div>
				<div style="float: left;">
					<div class="layui-form-item">
						<label class="layui-form-label">商户名称</label>
						<div class="layui-input-block">
							<input type="text" name="commercialName" placeholder="商户姓名" autocomplete="off" class="layui-input">
						</div>
					</div>
				</div>
				<div style="float: left;">
					<div class="layui-form-item">
						<label class="layui-form-label">时间范围</label>
						<div class="layui-input-block" style="float: left; margin-left: 0px;">
							<input type="text" name="startTime" id="startTime" placeholder="开始时间" autocomplete="off" class="layui-input">
						</div>
						<div style="float: left; font-weight: bold; margin: 10px;">~</div>
						<div class="layui-input-block" style="float: left; margin-left: 0px;">
							<input type="text" name="endTime" id="endTime" placeholder="结束时间" autocomplete="off" class="layui-input">
						</div>
					</div>
				</div>
				<div style="float: left;">
					<div class="layui-form-item">
						<div class="layui-input-block">
							<button class="layui-btn" lay-submit lay-filter="formDemo">查询</button>
						</div>
					</div>
				</div>
			</div>
		</form>
		<hr />
		<table id="demo" lay-filter="test" style="float: none;"></table>
	</body>
	<script type="text/javascript" src="../../bangnuo/admin/layui/layui.js"></script>
	<script>
		layui.use(['table', 'form' ,'laydate'], function() {
			var table = layui.table,
				form = layui.form,
				laydate = layui.laydate;
				
				//日期选择器
				laydate.render({ 
				  elem: '#startTime'
				  //,type: 'date' //默认，可不填
				});
				//日期选择器
				laydate.render({ 
				  elem: '#endTime'
				  //,type: 'date' //默认，可不填
				});
				

			form.on('submit(formDemo)', function(data) {
				layer.msg(JSON.stringify(data.field));
				var adminEntity = {
					"employeeName": data.field.employeeName,
					"employeeId": data.field.employeeId,
					"commercialId": data.field.commercialId,
					"commercialName": data.field.commercialName,
					"startTime": data.field.startTime,
					"endTime": data.field.endTime
				};
				table.reload('demo', {
					url: '/adminEntity/performanceEnquiry',
					page:{
						curr:1
					},
					where: adminEntity
				});
				return false;
			});

			//第一个实例
			table.render({
				elem: '#demo',
				url: '/adminEntity/performanceEnquiry', //数据接口
				page: true, //开启分页
				method: 'post',
				toolbar: '#toolbarDemo', //开启头部工具栏，并为其绑定左侧模板
				contentType: "application/json;charset=UTF-8",
				response: {
					"statusName": "code",
					"statusCode": 10000,
					"msgName": "message",
					"countName": "total",
					"dataName": "queryResult"
				},
				parseData: function(res) {
					return {
						"code": res.code,
						"message": res.message,
						"total": res.queryResult.total,
						"queryResult": res.queryResult.list
					};
				},
				request: {
					pageName: 'page' //页码的参数名称，默认：page
						,
					limitName: 'size' //每页数据量的参数名，默认：limit
				},
				cols: [
					[ //表头
						{
							field: 'commercialId',
							title: '商户编号',
							sort: true,
							fixed: 'left'
						}, {
							field: 'CommercialName',
							title: '商户名称'
						}, {
							field: 'status',
							title: '商户状态',
							sort: true
						}, {
							field: 'employeeId',
							title: '业务员编号'
						}, {
							field: 'employeeName',
							title: '业务员姓名'
						}, {
							field: 'createTime',
							title: '注册时间',
							sort: true
						}
					]
				]
			});
		});
	</script>
</html>
